<?php
/**
 * Abstract Class For Controller, also contains useful page functionality
 *
 * @package Mhtml
 * @author Matt Pike
 */
abstract class Controller{

	public $controller	= null;
	public $action		= null;
	
	/**
	 * Redirect to url
	 * 
	 * @param string $url
	 */
	public function redirect($url){
		@ob_end_clean(); // clear output buffer
		header("HTTP/1.1 301 Moved Permanently");
		header("Location: ". strval($url));
		exit();
	}

	/**
	 * Set content header i.e. "application/json"
	 *
	 * @param string $type
	 */
	public function setContentType(){
		header("Content-type: $type");
	}

	/**
	 * Get the view name that has been passed to render()
	 *
	 * @return string
	 */
	public function getRenderedView(){
		return $this->renderedView;
	}
}
?>